* README FILE FOR BINGLEY AND CAPPELLARI'S 
* "CORRELATION OF BROTHERS' EARNINGS AND INTERGENERATIONAL TRANSMISSION"
* STATA V 13.1

clear all
set maxvar 30000
do triplet-data-creation-20160706   //Sources earnings data from Statistics Denmark's server archives to local directory
do data-creation-triplet-education	//Sources education data from Statistics Denmark's server archives to local directory
do inspection						//prepares sample and long form log earnings
do descriptives						//produces Table 1
do demean							//residualizes earnings
do merxn							//computes the moments at the individual level, calls:
										//coxavn.do, which computes moments by cohort and member type 
										//accinit.do, which stacks moments over cohorts and member type
									
do demean_extrad					//computes moments between members, calls:
										// coxavn_extrad.do, which computes moments by cohort between member types
										
do correlation_newter				//produces Figure 1, calls:   
										//reconstruct_extrad.do, which assembles  the various types of moments (within and between members)

do model_spl_tw_tco_fx_WN_notime 	//produces Table 2, calls:
										//reconstruct_extrad.do which assembles  the various types of moments (within and between members)  
										//diagncobis.do which does S.E. adjustment

do model_rwIDrgREIG 				//produces Table 3 and Figure 2, calls:
										//reconstruct_extrad.do which assembles  the various types of moments (within and between members)  
										//diagncobis.do which does S.E. adjustment


do corrcov_TI						//produces Table 4
do het_IGE							//produces Table 5










